DROP FUNCTION IF EXISTS usp_[%tablename%]_select(bigint);

CREATE OR REPLACE FUNCTION usp_[%tablename%]_select (param_id bigint)  

RETURNS TABLE ([%columnstypes%]) AS $$
                                                
    BEGIN
    -- Select a record from [%tablename%] by id.
	--  [%datestamp%] - auto generated
      RETURN QUERY
  SELECT
   [%columns%]
  FROM [%tablename%] t
  WHERE 
    t.id = param_id  
	AND t.is_deleted = 0; 
                                                         
END;
$$ LANGUAGE plpgsql;
